home *** CD-ROM | disk | FTP | other *** search
Modula Definition | 1995-08-25 | 30.8 KB | 500 lines |
- (* REVISION HEADER ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× *
-
- | $VER: TritonD.def 1.10 (02.06.94) by Stefan Schulz [sts]
-
- | Desc: Interface to Triton.library, Definition Part
-
- | Dist: This Module is © Copyright 1994 by Stefan Schulz
- | It may be freely Distributed (Freeware)
-
- | Rqrs: triton.library V1.1
- | Triton is © Copyright 1993/1994 by Stefan Zeiger
-
- | Lang: M2Amiga
- | Trns: M2Amiga Modula 2 Software Development System
- | © Copyright by A+L AG, CH-2540 Grenchen
-
- | Hist: Revision 1.10 [sts] \02.06.95\\02.06.95\
- | `- Updated to Triton release 4
-
- | Hist: Revision 1.01 [sts] \26.09.94\\26.09.94\
- | `- Names corrected to M2 Standard
-
- | Hist: Revision 1.00 [sts] \05.09.94\\06.09.94\
- | `- initial revision
-
- * ×××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××× *)
-
- DEFINITION MODULE TritonD; (*$ Implementation:= FALSE *)
-
- (* IMPORTS ********************************************************************** *)
-
- IMPORT ed : ExecD,
- gtd : GadToolsD,
- gd : GraphicsD,
- ie : InputEvent,
- ind : IntuitionD,
- S : SYSTEM,
- ud : UtilityD,
- wd : WorkbenchD;
-
- (* ****************************************************************************** *)
-
- (* ------------------------------------------------------------------------------ *)
- (* library name and version *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST tritonName = "triton.library";
- tritonVersion = 1;
-
- (* ------------------------------------------------------------------------------ *)
- (* Pointers to everything *)
- (* ------------------------------------------------------------------------------ *)
-
- TYPE AppPtr = POINTER TO App;
- DimensionsPtr = POINTER TO Dimensions;
- MessagePtr = POINTER TO Message;
- ProjectPtr = POINTER TO Project;
-
- TYPE (* for readability *)
- StrPtr = S.ADDRESS;
- BOOL = INTEGER; (* has to be SIZE(WORD), so no BOOLEANs *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Triton Message *)
- (* ------------------------------------------------------------------------------ *)
-
- TYPE Message = RECORD
- project : ProjectPtr; (* The project which triggered *)
- (* the message *)
- id : LONGCARD; (* The object's ID *)
- class : LONGCARD; (* The Triton message class *)
- data : LONGCARD; (* The class-specific data *)
- code : LONGCARD; (* Currently only used by *)
- (* msKEYPRESSED *)
- pad0 : CARDINAL; (* qualifier is only 16 Bit *)
- qualifier : ie.QualifierSet;(* Qualifiers *)
- seconds : LONGCARD; (* \ Copy of system clock time *)
- micros : LONGCARD; (* / (Only where available! If *)
- (* not set, seconds is NULL) *)
- app : AppPtr; (* The project's application *)
- END; (* Message *)
-
- CONST (* Message Classes *)
- msCloseWindow = 1; (* The window should be closed *)
- msError = 2; (* An error occured. Error code in 'data' *)
- msNewValue = 3; (* Object's value has changed. New value in 'data' *)
- msAction = 4; (* Object has triggered an action *)
- msIconDropped = 5; (* Icon dropped over window ('id'=0) or DropBox. *)
- (* AppMessagePtr in 'data' *)
- msKeyPressed = 6; (* Key pressed. 'data' contains ASCII code, 'code' *)
- (* raw code and 'qualifier' contains qualifiers *)
- msHelp = 7; (* The user requested help for the specified ID *)
- msDiskInserted= 8; (* A disk has been inserted into a drive *)
- msDiskRemoved = 9; (* A disk has been removed from a drive *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Triton Error Codes *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST erOK = 0; (* No error *)
-
- erAllocMem = 1; (* Not enough memory *)
- erOpenWindow = 2; (* Can't open window *)
- erWindowTooBig = 3; (* Window would be too big for screen *)
- erDrawInfo = 4; (* Can't get screen's DrawInfo *)
- erOpenFont = 5; (* Can't open font *)
- erCreateMsgPort = 6; (* Can't create message port *)
- erInstallObject = 7; (* Can't create an object *)
- erCreateClass = 8; (* Can't create a class *)
- erNoLockPubScreen = 9; (* Can't lock public screen *)
- erCreateMenus = 12; (* Error while creating the menus *)
- erGTCreateContext = 14; (* Can't create gadget context *)
-
- erMaxErrorNum = 15; (* PRIVATE! *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Tags for OpenProject *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST (* Window/Project *)
- wiTitle = ud.tagUser+1; (* STRPTR: The window title *)
- wiFlags = ud.tagUser+2; (* See below for window flags *)
- wiUnderscore = ud.tagUser+3; (* CharPtr: The underscore for *)
- (* menu and gadget shortcuts *)
- wiPosition = ud.tagUser+4; (* Window position, see below *)
- wiCustomScreen = ud.tagUser+5; (* ScreenPtr *)
- wiPubScreen = ud.tagUser+6; (* ScreenPtr, must have been *)
- (* locked! *)
- wiPubScreenName = ud.tagUser+7; (* StrPtr, Triton is doing the *)
- (* locking *)
- wiPropFontAttr = ud.tagUser+8; (* TextAttrPtr: proportional font *)
- wiFixedWidthFontAttr = ud.tagUser+9; (* TextAttrPtr: fixed-width font *)
- wiBackfill = ud.tagUser+10; (* The backfill type, see below *)
- wiID = ud.tagUser+11; (* LONGCARD: The window ID *)
- wiDimensions = ud.tagUser+12; (* DimensionsPtr *)
- wiScreenTitle = ud.tagUser+13; (* StrPtr: The screen title *)
-
- CONST (* Menus *)
- mnTitle = ud.tagUser+101; (* StrPtr: Menu *)
- mnItem = ud.tagUser+102; (* StrPtr: Menu item *)
- mnSub = ud.tagUser+103; (* StrPtr: Menu subitem *)
- mnFlags = ud.tagUser+104; (* See below for flags *)
-
- CONST (* General object attributes *)
- atID = ud.tagUser+150; (* The object's/menu's ID *)
- atFlags = ud.tagUser+151; (* The object's flags *)
- atValue = ud.tagUser+152; (* The object's value *)
- atText = ud.tagUser+153; (* The object's text *)
- atDisabled = ud.tagUser+154; (* Disabled object? *)
- atBackfill = ud.tagUser+155; (* Backfill pattern *)
- atMinWidth = ud.tagUser+156; (* Minimum width *)
- atMinHeight = ud.tagUser+157; (* Minimum height *)
-
- obUSER = ud.tagUser+800; (* PRIVATE! *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Window Flags *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST wfBackDrop = 00000001H; (* Create a backdrop borderless *)
- (* window *)
- wfNoDragBar = 00000002H; (* Don't use a dragbar *)
- wfNoDepthGadget = 00000004H; (* Don't use a depth-gadget *)
- wfNoCloseGadget = 00000008H; (* Don't use a close-gadget *)
- wfNoActivate = 00000010H; (* Don't activate window *)
- wfNoEscClose = 00000020H; (* Don't send msCloseWindow when *)
- (* Esc is pressed *)
- wfNoPScrFallBack = 00000040H; (* Don't fall back onto default *)
- (* PubScreen *)
- wfNoZipGadget = 00000080H; (* Don't use a zip-gadget *)
- wfZipCenterTop = 00000100H; (* Center the zipped window on the *)
- (* title bar *)
- wfNoMinTextWidth = 00000200H; (* Minimum window width not according *)
- (* to title text *)
- wfNoSizeGadget = 00000400H; (* Don't use a sizing-gadget *)
- wfNoFontFallBack = 00000800H; (* Don't fall back to topaz.8 *)
- wfNoDelZip = 00001000H; (* Don't zip the window when Del is *)
- (* pressed *)
- wfSimpleRefresh = 00002000H; (* Use simple refresh instead of *)
- (* smart refresh *)
- wfZipToCurrentPos = 00004000H; (* Will zip the window at the current *)
- (* position (OS3.0+) *)
- wfAppWindow = 00008000H; (* Create an AppWindow without using *)
- (* class_dropbox *)
- wfActivateStrGad = 00010000H; (* Activate the first string gadget *)
- (* after opening the window *)
- wfHelp = 00020000H; (* Pressing <Help> will create a *)
- (* msHelp message *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Menu Flags *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST mfCheckIt = 00000001H; (* Leave space for a checkmark *)
- mfCheckEd = 00000002H; (* Check the item (includes *)
- (* mfCheckIt) *)
- mfDisabled = 00000004H; (* Ghost the menu/item *)
-
-
- (* ------------------------------------------------------------------------------ *)
- (* Window positions *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST wpDefault = 0; (* Get Triton choose a good position *)
- wpBelowTitleBar = 1; (* Left side of screen, below title bar *)
- wpCenterTop = 1025; (* Top of screen, centered on the title bar *)
- wpTopLeftScreen = 1026; (* Top left corner of screen *)
- wpCenterScreen = 1027; (* Centered on the screen *)
- wpCenterDisplay = 1028; (* Centered on the currently displayed clip *)
- wpMousePointer = 1029; (* Under the mouse pointer *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Backfill types *)
- (* ------------------------------------------------------------------------------ *)
-
- bfWindowBack = 0; (* Window backfill colors *)
- bfRequesterBack = 1; (* Requester backfill colors *)
- bfNone = 2; (* No backfill (= Fill with BackgroundPen) *)
- bfShine = 3; (* Fill with ShinePen *)
- bfShineShadow = 4; (* Fill with ShinePen + ShadowPen *)
- bfShineFill = 5; (* Fill with ShinePen + FillPen *)
- bfShineBackground = 6; (* Fill with ShinePen + BackgroundPen *)
- bfShadow = 7; (* Fill with ShadowPen *)
- bfShadowFill = 8; (* Fill with Shadowpen + FillPen *)
- bfShadowBackground = 9; (* Fill with ShadowPen + BackgroundPen *)
- bfFill = 10; (* Fill with FillPen *)
- bfFillBackground = 11; (* Fill with FillPen + BackgroundPen *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Display Object Flags *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST (* General flags *)
- ofRaised = 00000001H; (* Raised object *)
- ofHoriz = 00000002H; (* Horizontal object \ Works automatically *)
- ofVert = 00000004H; (* Vertical object / in groups *)
- ofRightAlign = 00000008H; (* Align object to the right border if *)
- (* available *)
-
- CONST (* Text flags *)
- txNoUnderscore= 00000100H; (* Don't interpret underscores *)
- txHighlight = 00000200H; (* Highlight text *)
- tx3D = 00000400H; (* 3D design *)
- txBold = 00000800H; (* Softstyle 'bold' *)
- txTitle = 00001000H; (* A title (e.g. of a group) *)
- txSelected = 00002000H; (* PRIVATE! *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Menu entries *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST menuBarLabel = -1; (* A barlabel instead of text *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Tags for CreateApp() *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST caName = ud.tagUser+1;
- caLongName = ud.tagUser+2;
- caInfo = ud.tagUser+3;
- caVersion = ud.tagUser+4;
- caRelease = ud.tagUser+5;
- caDate = ud.tagUser+6;
-
- (* ------------------------------------------------------------------------------ *)
- (* Tags for EasyRequest() *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST ezReqPos = ud.tagUser+1;
- ezLockProject = ud.tagUser+2;
- ezReturn = ud.tagUser+3;
- ezTitle = ud.tagUser+4;
- ezActivate = ud.tagUser+5;
-
- (* ------------------------------------------------------------------------------ *)
- (* The Application Structure *)
- (* ------------------------------------------------------------------------------ *)
-
- TYPE App = RECORD (* This structure is PRIVATE! *)
- memPool : S.ADDRESS; (* The memory pool *)
- bitMask : LONGCARD; (* Bits to Wait() for *)
- lastError : LONGCARD; (* code of last error *)
- name : StrPtr; (* Unique name *)
- longName : StrPtr; (* User-readable name *)
- info : StrPtr; (* Info string *)
- version : StrPtr; (* Version *)
- release : StrPtr; (* Release *)
- date : StrPtr; (* Compilation date *)
- appPort : ed.MsgPortPtr;(* Application message port *)
- idcmpPort : ed.MsgPortPtr;(* IDCMP message port *)
- prefs : S.ADDRESS; (* Pointer to Triton app prefs *)
- lastProject: ProjectPtr; (* Used for menu item linking *)
- inputEvent : ie.InputEventPtr; (* For RawKey conversion *)
- END; (* App *)
-
- (* ------------------------------------------------------------------------------ *)
- (* The Dimension Structure *)
- (* ------------------------------------------------------------------------------ *)
-
- TYPE Dimensions = RECORD
- left : CARDINAL;
- top : CARDINAL;
- width : CARDINAL;
- height : CARDINAL;
- left2 : CARDINAL;
- top2 : CARDINAL;
- width2 : CARDINAL;
- height2 : CARDINAL;
- zoomed : BOOL;
- reserved : ARRAY [0..2] OF CARDINAL;
- END; (* Dimensions *)
-
- (* ------------------------------------------------------------------------------ *)
- (* The Projects Structure *)
- (* ------------------------------------------------------------------------------ *)
-
- TYPE Project = RECORD (* This structure is PRIVATE! *)
- app : AppPtr; (* Our application *)
- screen : ind.ScreenPtr;(* Our screen, always valid *)
-
- lockedPubScreen:ind.ScreenPtr;(* Only valid if we're using*)
- (* a PubScreen *)
- screenTitle : StrPtr; (* The screen title *)
-
- window : ind.Window; (* The window *)
- id : LONGCARD; (* The window ID *)
- appWindow : wd.AppWindowPtr;(* AppWindow for icon *)
- (* dropping *)
-
- idcmpFlags : LONGCARD; (* The IDCMP flags *)
- flags : LONGCARD; (* Triton window flags *)
-
- newMenu : gtd.NewMenuPtr; (* The newmenu stucture *)
- (* built by Triton *)
- newMenuSize : LONGCARD; (* The number of menu *)
- (* items in the list *)
- menu : ind.MenuPtr; (* The menu structure *)
- nextSelect : LONGCARD; (* The next selected menu *)
- (* item *)
-
- visualInfo : S.ADDRESS; (* The VisualInfo of our *)
- (* window *)
- drawInfo : ind.DrawInfoPtr;(* DrawInfo of the screen *)
- userDimensions: DimensionsPtr; (* supplied dimensions *)
- dimensions : DimensionsPtr; (* Private dimensions *)
-
- windowStdHeight:LONGCARD; (* standard height of the window*)
- leftBorder : LONGCARD; (* left window border width *)
- rightBorder : LONGCARD; (* right window border width *)
- topBorder : LONGCARD; (* top window border height *)
- bottomBorder : LONGCARD; (* bottom window border height *)
- innerWidth : LONGCARD; (* inner width of the window *)
- innerHeight : LONGCARD; (* inner height of the window *)
- zipDimensions : ARRAY [0..3] OF INTEGER; (* The dimensions*)
- (* for the zipped window *)
- aspectFixing : CARDINAL; (*Pixel aspect correction factor*)
-
- objectList : ed.MinList; (* The list of display objects*)
- menuList : ed.MinList; (* The list of menus *)
- idList : ed.MinList; (* The ID linking list *)
- (* (menus & objects) *)
- memPool : S.ADDRESS; (* memory pool for the lists *)
- hasObjects : BOOL; (* Do we have display objects?*)
-
- propAttr : gd.TextAttrPtr; (* The proportional font *)
- (* attributes *)
- fixedWidthAttr: gd.TextAttrPtr; (* The fixed-width font *)
- (* attributes *)
- propFont : gd.TextFontPtr; (* The proportional font *)
- fixedWidthFont: gd.TextFontPtr; (* The fixed-width font *)
- openedPropFont: BOOL; (* Have we opened the *)
- openedFixedWidthFont: BOOL; (* fonts ? *)
- totalPropFontHeight : CARDINAL; (* Height of prop font *)
- (* incl. underscore *)
-
- backfillType : LONGCARD; (* The backfill type *)
- backfillHook : ud.HookPtr; (* The backfill hook *)
-
- gadToolsGadgetList: ind.GadgetPtr;(* List of GadTools *)
- (* gadgets *)
- prevGadget : ind.GadgetPtr; (* Previous gadget *)
- newGadget : gtd.NewGadgetPtr; (* GadTools NewGadget *)
-
- invisibleRequest: ind.RequesterPtr; (* The invisible *)
- (* blocking requester *)
- isUserLocked : BOOL; (* Project locked by the *)
- (* user? *)
-
- currentID : LONGCARD;(* currently keyboard-selected ID*)
- isCancelDown : BOOL; (* Cancellation key pressed? *)
- isShortcutDown: BOOL; (* Shortcut key pressed? *)
- underscore : CHAR; (* The underscore character *)
-
- escClose : BOOL; (* Close window on Esc ? *)
- delZip : BOOL; (* Zip window on Del ? *)
- pubScreenFallBack: BOOL; (* Fall back onto default public *)
- (* screen ? *)
- fontFallBack : BOOL; (* Fall back to topaz.8 ? *)
-
- oldWidth : CARDINAL;(* Old window width *)
- oldHeight : CARDINAL;(* Old window height *)
-
- END; (* Projects *)
-
- (* ------------------------------------------------------------------------------ *)
- (* Default classes, attributes and flags *)
- (* ------------------------------------------------------------------------------ *)
-
- CONST (* Object-Classes *)
-
- obButton = ud.tagUser+305; (* A BOOPSI button gadget *)
- obCheckBox = ud.tagUser+303; (* A checkbox gadget *)
- obCycle = ud.tagUser+310; (* A cycle gadget *)
- obFrameBox = ud.tagUser+306; (* A framing box *)
- obDropBox = ud.tagUser+312; (* An icon drop box *)
- grHoriz = ud.tagUser+201; (* Horizontal group,see below for types *)
- grVert = ud.tagUser+202; (* Vertical group, see below for types *)
- grEnd = ud.tagUser+203; (* End of a group *)
- obLine = ud.tagUser+301; (* A simple line *)
- obPalette = ud.tagUser+307; (* A palette gadget *)
- obScroller = ud.tagUser+309; (* A scroller gadget *)
- obSlider = ud.tagUser+308; (* A slider gadget *)
- obSpace = ud.tagUser+901; (* The spaces class *)
- obString = ud.tagUser+311; (* A string gadget *)
- obText = ud.tagUser+304; (* A line of text *)
- obListview = ud.tagUser+313; (* A listview gadget *)
- obProgress = ud.tagUser+314; (* A progress indicator *)
- obImage = ud.tagUser+315; (* An image *)
-
- CONST (* Button *)
- buReturnOK = 00010000H; (* <Return> answers the button *)
- buEscOK = 00020000H; (* <Esc> answers the button *)
- buShifted = 00040000H; (* Shifted shortcut only *)
- buUnshifted = 00080000H; (* Unshifted shortcut only *)
- buYResize = 00100000H; (* Button resizeable in Y direction *)
- btText = 0; (* Text button *)
- btGetFile = 1; (* GetFile button *)
- btGetDrawer = 2; (* GetDrawer button *)
- btGetEntry = 3; (* GetEntry button *)
-
- CONST (* Group *)
- grPropShare = 00000000H; (* Default: Divide objects proportionally *)
- grEqualShare = 00000001H; (* Divide objects equally *)
- grPropSpaces = 00000002H; (* Divide spaces proportionally *)
- grArray = 00000004H; (* Top-level array group *)
-
- grAlign = 00000008H; (* Align resizeable objects in secondary *)
- (* dimension *)
- grCenter = 00000010H; (* Center unresizeable objects in *)
- (* secondary dimension *)
-
- grFixHoriz = 00000020H; (* Don't allow horizontal resizing *)
- grFixVert = 00000040H; (* Don't allow vertical resizing *)
- grIndep = 00000080H; (* Group is independant of surrounding *)
- (* array *)
-
- CONST (* Framebox *)
- fbGrouping = 00000001H; (* A grouping box *)
- fbFraming = 00000002H; (* A framing box *)
- fbText = 00000004H; (* A text container *)
-
- CONST (* Scroller *)
- scTotal = ud.tagUser+1504;
- scVisible = ud.tagUser+1505;
-
- CONST (* Slider *)
- slMin = ud.tagUser+1502;
- slMax = ud.tagUser+1503;
-
- CONST (* Space *)
- stFree = NIL;
- stNone = 1; (* No space *)
- stSmall = 2; (* Small space *)
- stNormal = 3; (* Normal space (default) *)
- stBig = 4; (* Big space *)
-
- CONST (* Listview *)
- lvTop = ud.tagUser+1506;
- lvReadOnly = 00010000H; (* A read-only list *)
- lvSelect = 00020000H; (* You may select an entry *)
- lvShowSelected = 00040000H; (* Selected entry will be shown *)
- lvNoCursorKeys = 00080000H; (* Don't use arrow keys *)
- lvNoNumpadKeys = 00100000H; (* Don't use numeric keypad keys *)
- lvFWFont = 00200000H; (* Use the fixed-width font *)
- lvNoGap = 00400000H; (* Don't leave a gap below the list *)
-
- CONST (* Image *)
- imBoopsi = 00010000H; (* Use a BOOPSI IClass image *)
-
- CONST (* Cycle *)
- cyMX = 00010000H; (* Unfold the cycle gadget to a MX gadget *)
- cyRightLabels = 00020000H; (* Put labels to the right of a MX gadget *)
-
- CONST (* String *)
- stInvisible = 00010000H; (* A password gadget -> invisible typing *)
- stNoReturnBroadcast = 00020000H; (* <Return> keys will not be broadcast *)
- (* to the window *)
-
- END TritonD.def
-